package lt.ntec.danblog.server.core.validator.rules;

import lt.ntec.danblog.server.core.Message;
import lt.ntec.danblog.server.core.SimpleMessage;
import lt.ntec.danblog.server.core.validator.Rule;

public class TitleRule extends PatternRule implements Rule {

    @Override
    protected String getPattern() {
        return "^[\\w\\d!-~]+[\\w\\s\\d!-~]+";
    }

    @Override
    public Message getMessage() {
        return new SimpleMessage(Message.Type.NOTICE, "Title contains invalid characters");
    }
}
